package com.afu.strategy;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * ClassName: HikParking
 * Package: com.afu.strategy
 * Description:
 *
 * @Version 1.0
 */
@Component
public class ParkingTypeContext {

    @Autowired
    private Map<String,ParkingTypeStrategy> parkingTypeStrategyMap = new HashMap<>();

    @Autowired
    private List<ParkingTypeStrategy> list = new ArrayList<>();

    public ParkingTypeStrategy getParkingType(ParkingTypeEnum parkingTypeEnum){
        for (ParkingTypeStrategy parkingTypeStrategy : list) {
            System.out.println(parkingTypeStrategy.getClass().getName());
        }
        return parkingTypeStrategyMap.get(parkingTypeEnum.getName());

    }

}
